<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/1 0001
  Time: 14:35
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>

<script src="${path}/static/taoshunda/problem/problem.js"></script>
<script type="text/javascript" src="${path}/static/bootstrap/bootstrap-table/bootstrap-table.js"></script>
<link href="${path}/static/css/public/public.css" rel="stylesheet" type="text/css">

<script>
    var answerAdd = UE.getEditor('answerAdd');
    var answerObtain = UE.getEditor('answerObtain');
</script>

<div style="float: left">
    <button class="btn query_button" id="addProblem" style="width: 200%;margin-bottom: 4%">
        添加
    </button>
</div>

<table id="table"
       data-toggle="table"
       data-url="${path}/web/app/queryProblem"
       data-toolbar="#toolbar"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200]"
>
    <thead>
    <tr>
        <th data-field="question">问题</th>
        <th data-field="answer">答案</th>
        <th data-formatter="type">类型</th>
        <th data-formatter="problemFormatter" data-events="problemEvent">操作</th>
    </tr>
    </thead>
</table>

<div id="addProblem-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="50%">
    <div class="box-header">
        <h3 class="box-title">添加常见问题</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <form role="form" method="post" id="addProblemFrom">

                <div class="form-group">
                    <input id="select" type="hidden" name="type">
                    <label>分类:</label><br>
                    <select type="text" class="form-control entry" id="type" style="width: 50%;">
                        <option value="0">--请选择--</option>
                        <option value="1">用户端</option>
                        <option value="2">商家端</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>问题:</label><br>
                    <input type="text" class="form-control entry" id="question" name="question" style="width: 50%">
                </div>

                <div class="form-group">
                    <label>答案:</label><br>
                    <textarea hidden="hidden" class="form-control entry" id="answer" name="answer"
                              style="width: 50%;height: 200px"></textarea>
                    <script class="editor" id="answerAdd" type="text/plain"
                            style="width:700px;height:200px;"></script>
                </div>

            </form>
            <div class="box-footer">
                <button class="btn btn-info" data-event="submit-addProblem">确定</button>
                &nbsp;
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>


<div id="updateProblem-div" class="slidingmenu box-model box box-info" style="z-index:0;" model-width="50%">
    <div class="box-header">
        <h3 class="box-title">修改常见问题</h3>
    </div>
    <div class="box box-info">
        <div class="box-body">
            <form role="form" method="post" id="updateProblemFrom">
                <input type="hidden" name="id" id="id">

                <div class="form-group">
                    <input id="selectUpdate" type="hidden" name="type">
                    <label>分类:</label><br>
                    <select type="text" class="form-control entry" id="typeUpdate" style="width: 50%;">
                        <option value="0">--请选择--</option>
                        <option value="1">用户端</option>
                        <option value="2">商家端</option>
                    </select>
                </div>

                <div class="form-group">
                    <label>问题:</label><br>
                    <input type="text" class="form-control entry" id="problem" name="question" style="width: 50%">
                </div>

                <div class="form-group">
                    <label>答案:</label><br>
                    <textarea hidden="hidden" class="form-control entry" id="answerUpdate" name="answer"
                              style="width: 50%;height: 200px"></textarea>
                    <script class="editor" id="answerObtain" type="text/plain"
                            style="width:700px;height:200px;"></script>
                </div>

            </form>
            <div class="box-footer">
                <button class="btn btn-info" data-event="submit-updateProblem">确定</button>
                &nbsp;
                <button class="btn btn-danger close-model">关闭</button>
            </div>
        </div>
    </div>
</div>